import React from 'react'
import './index.scss'
import { NavBar } from 'react-vant';
import { useNavigate } from 'react-router-dom'
import { List } from 'antd-mobile'
const Index: React.FC = () => {
    const userinfor = JSON.parse(localStorage.getItem('userinfor') as string) || ''
    const navigate = useNavigate()
    function handleClick() {
        // ...
    }
    const huan = () => {
        localStorage.removeItem('userInfo')
        navigate('/login')
    }
    const tui = () => {
        localStorage.removeItem('userInfo')
        navigate('/login')
    }
    return (
        <div>
            <div className='head'>
                <NavBar fixed={true}
                    title="标题"
                    leftText="返回"
                    onClickLeft={() => navigate(-1)}
                />
            </div>
            <div className='body'>
                <div><List.Item extra={userinfor.username} onClick={handleClick}>用户名 </List.Item></div>
                <div><List.Item extra='修改绑定手机/密码等' onClick={handleClick}>账号与安全</List.Item></div>
                <div><List.Item extra='隐私政策/应用权限说明等' onClick={handleClick}>账号与安全</List.Item></div>
                <div><List.Item extra='管理APP使用的系统权限' onClick={handleClick}>权限管理</List.Item></div>
                <div><List.Item extra='已开启' clickable>消息通知设置</List.Item></div>
                <div><List.Item extra='清空缓存/上传日志等' onClick={handleClick}>账号与安全</List.Item></div>
                <div><List.Item extra='长辈模式/标准模式' onClick={handleClick}>账号与安全</List.Item></div>
                <div><List.Item extra='小' onClick={handleClick}>权限管理</List.Item></div>
                <div><List.Item extra='斌荣播放器' clickable>消息通知设置</List.Item></div>
                <div><List.Item clickable>个人信息收集清单</List.Item></div>
                <div><List.Item clickable>第三方信息数据共享</List.Item></div>
                <div><List.Item extra='v8.4.9' clickable>关于好大夫                                                                                                                  </List.Item></div>
            </div>
            <div className='dibu'>
                <div><button onClick={huan}>切换账号</button></div>
                <div><button onClick={tui}>退出登录</button></div>
            </div>
        </div>
    )
}

export default Index